package com.smart.campus.school.service;

import java.util.List;
import com.smart.campus.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.ExamResultsMapper;
import com.smart.campus.school.domain.ExamResults;
import com.smart.campus.school.service.IExamResultsService;
import com.smart.campus.common.core.text.Convert;

/**
 * resultsService业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-06-29
 */
@Service
public class ExamResultsServiceImpl implements IExamResultsService 
{
    @Autowired
    private ExamResultsMapper examResultsMapper;

    /**
     * 查询results
     * 
     * @param id resultsID
     * @return results
     */
    @Override
    public ExamResults selectExamResultsById(Long id)
    {
        return examResultsMapper.selectExamResultsById(id);
    }

    /**
     * 查询results列表
     * 
     * @param examResults results
     * @return results
     */
    @Override
    public List<ExamResults> selectExamResultsList(ExamResults examResults)
    {
        return examResultsMapper.selectExamResultsList(examResults);
    }

    /**
     * 新增results
     * 
     * @param examResults results
     * @return 结果
     */
    @Override
    public int insertExamResults(ExamResults examResults)
    {
        examResults.setCreateTime(DateUtils.getNowDate());
        return examResultsMapper.insertExamResults(examResults);
    }

    /**
     * 修改results
     * 
     * @param examResults results
     * @return 结果
     */
    @Override
    public int updateExamResults(ExamResults examResults)
    {
        return examResultsMapper.updateExamResults(examResults);
    }

    /**
     * 删除results对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExamResultsByIds(String ids)
    {
        return examResultsMapper.deleteExamResultsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除results信息
     * 
     * @param id resultsID
     * @return 结果
     */
    @Override
    public int deleteExamResultsById(Long id)
    {
        return examResultsMapper.deleteExamResultsById(id);
    }
}
